home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DELPHI32 / GRAPHICS / IMGLIB95 / U_GL_PAL.PA_ / U_GL_PAL.PA
Text File  |  1996-03-31  |  2KB  |  91 lines

  1. {
  2. Written by Jan Dekkers and Kevin Adams (c) 1995, 1996. If you are a non
  3. registered client, you may use or alter this demo only for evaluation
  4. purposes.
  5.  
  6. Copyright by SkyLine Tools. All rights reserved.
  7.  
  8. Part of Imagelib VCL/DLL Library.
  9. }
  10.  
  11. unit U_gl_pal;
  12.  
  13. {Includes settings to compile in either 16 or 32 bit}
  14. {$I DEFILIB.INC}
  15.  
  16. interface
  17.  
  18. uses
  19. {$IFDEF DEL32}
  20.    Windows,
  21. {$ELSE}
  22.    WinTypes,
  23.    WinProcs,
  24. {$ENDIF}
  25.    DLL95V1,     {ImageLib Dll interface and misc. functions}
  26.    Classes,
  27.    Graphics,
  28.    Forms,
  29.    Controls,
  30.    Buttons,
  31.    StdCtrls,
  32.    MMOpen,      {Visual OpenDialog box}
  33.    TMultiP;     {PMultiImage VCL component}
  34.  
  35. type
  36.   TGPaletteD = class(TForm)
  37.     PMultiImage2: TPMultiImage;
  38.     PMultiImage1: TPMultiImage;
  39.     MMOpenDialog1: TMMOpenDialog;
  40.     CheckBox1: TCheckBox;
  41.     BitBtn1: TBitBtn;
  42.     BitBtn2: TBitBtn;
  43.     Memo1: TMemo;
  44.     procedure CheckBox1Click(Sender: TObject);
  45.     procedure BitBtn1Click(Sender: TObject);
  46.     procedure BitBtn2Click(Sender: TObject);
  47.   private
  48.     { Private declarations }
  49.   public
  50.     { Public declarations }
  51.   end;
  52.  
  53. var
  54.   GPaletteD: TGPaletteD;
  55.  
  56. implementation
  57.  
  58. {$R *.DFM}
  59. {------------------------------------------------------------------------}
  60.  
  61. procedure TGPaletteD.CheckBox1Click(Sender: TObject);
  62. begin
  63.   if CheckBox1.Checked then
  64.    GlobalPalette:=PMultiImage1.Picture.Bitmap.Palette
  65.   else
  66.    GlobalPalette:=0;
  67. end;
  68. {------------------------------------------------------------------------}
  69.  
  70. procedure TGPaletteD.BitBtn1Click(Sender: TObject);
  71. begin
  72.   if MMOpenDialog1.Execute then
  73.       PMultiImage1.Imagename:=MMOpenDialog1.FileName;
  74. end;
  75. {------------------------------------------------------------------------}
  76.  
  77. procedure TGPaletteD.BitBtn2Click(Sender: TObject);
  78. begin
  79.  
  80.   if CheckBox1.Checked then
  81.    GlobalPalette:=PMultiImage1.Picture.Bitmap.Palette
  82.   else
  83.    GlobalPalette:=0;
  84.  
  85.   if MMOpenDialog1.Execute then
  86.       PMultiImage2.Imagename:=MMOpenDialog1.FileName;
  87. end;
  88. {------------------------------------------------------------------------}
  89.  
  90. end.
  91.